#include "securityinfor.h"

SecurityInfor* SecurityInfor::_instance=nullptr;

SecurityInfor* SecurityInfor::GetInstance(QObject* parent){
    if(SecurityInfor::_instance==nullptr)
        SecurityInfor::_instance=new SecurityInfor(parent);
    return SecurityInfor::_instance;
}

SecurityInfor::~SecurityInfor(){

}

void SecurityInfor::SubmitInfor(Yzty::ITEMCODE mcode,QVector<Yzty::BaceInfor*>& infors){
    std::lock_guard<std::mutex> glock(this->_mutex);
    this->_infors[mcode]=std::move(infors);
}

const QVector<Yzty::BaceInfor*>& SecurityInfor::GetItemInfor(Yzty::ITEMCODE icode){
    std::lock_guard<std::mutex> glock(this->_mutex);
    return this->_infors[icode];
}

SecurityInfor::SecurityInfor(QObject* parent):QObject (parent),_infors(int(Yzty::SecurityToolCode::NUMS)){

}
